.TH "conf_general.c" 3 "Wed Sep 16 2015" "Doxygen" \" -*- nroff -*-
.ad l
.nh
.SH NAME
conf_general.c \- 
.SH SYNOPSIS
.br
.PP
\fC#include 'conf_general\&.h'\fP
.br
\fC#include 'ch\&.h'\fP
.br
\fC#include 'eeprom\&.h'\fP
.br
\fC#include 'mcpwm\&.h'\fP
.br
\fC#include 'hw\&.h'\fP
.br
\fC#include 'utils\&.h'\fP
.br
\fC#include <string\&.h>\fP
.br
\fC#include 'mcconf_outrunner2\&.h'\fP
.br

.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBMC_DEFAULT_MOTOR_TYPE\fP   \fBMOTOR_TYPE_BLDC\fP"
.br
.ti -1c
.RI "#define \fBMCPWM_PWM_MODE\fP   \fBPWM_MODE_SYNCHRONOUS\fP"
.br
.ti -1c
.RI "#define \fBMCPWM_MIN_VOLTAGE\fP   8\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_MAX_VOLTAGE\fP   50\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_BATTERY_CUT_START\fP   10\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_BATTERY_CUT_END\fP   8\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_RPM_MAX\fP   100000\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_RPM_MIN\fP   \-100000\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_CURRENT_STARTUP_BOOST\fP   0\&.01"
.br
.ti -1c
.RI "#define \fBMCPWM_RPM_LIMIT_NEG_TORQUE\fP   true"
.br
.ti -1c
.RI "#define \fBMCPWM_CURR_MAX_RPM_FBRAKE\fP   300"
.br
.ti -1c
.RI "#define \fBMCPWM_CURR_MAX_RPM_FBRAKE_CC\fP   1500"
.br
.ti -1c
.RI "#define \fBMCPWM_SLOW_ABS_OVERCURRENT\fP   false"
.br
.ti -1c
.RI "#define \fBMCPWM_COMM_MODE\fP   \fBCOMM_MODE_INTEGRATE\fP"
.br
.ti -1c
.RI "#define \fBMCPWM_CYCLE_INT_LIMIT_HIGH_FAC\fP   0\&.8"
.br
.ti -1c
.RI "#define \fBMCPWM_CYCLE_INT_START_RPM_BR\fP   80000\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_FAULT_STOP_TIME\fP   3000"
.br
.ti -1c
.RI "#define \fBMCPWM_LIM_TEMP_FET_START\fP   80\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_LIM_TEMP_FET_END\fP   100\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_LIM_TEMP_MOTOR_START\fP   80\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_LIM_TEMP_MOTOR_END\fP   100\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_MAX_FB_CURR_DIR_CHANGE\fP   10\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_MIN_DUTY\fP   0\&.005"
.br
.ti -1c
.RI "#define \fBMCPWM_MAX_DUTY\fP   0\&.95"
.br
.ti -1c
.RI "#define \fBMCPWM_RAMP_STEP\fP   0\&.02"
.br
.ti -1c
.RI "#define \fBMCPWM_RAMP_STEP_RPM_LIMIT\fP   0\&.0005"
.br
.ti -1c
.RI "#define \fBMCPWM_CURRENT_LIMIT_GAIN\fP   0\&.5"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_ERPM\fP   2000\&.0"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_0\fP   \-1"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_1\fP   1"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_2\fP   3"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_3\fP   2"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_4\fP   5"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_5\fP   6"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_6\fP   4"
.br
.ti -1c
.RI "#define \fBMCPWM_HALL_TAB_7\fP   \-1"
.br
.ti -1c
.RI "#define \fBEEPROM_BASE_MCCONF\fP   1000"
.br
.ti -1c
.RI "#define \fBEEPROM_BASE_APPCONF\fP   2000"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBconf_general_init\fP (void)"
.br
.ti -1c
.RI "void \fBconf_general_read_app_configuration\fP (\fBapp_configuration\fP *conf)"
.br
.ti -1c
.RI "bool \fBconf_general_store_app_configuration\fP (\fBapp_configuration\fP *conf)"
.br
.ti -1c
.RI "void \fBconf_general_read_mc_configuration\fP (\fBmc_configuration\fP *conf)"
.br
.ti -1c
.RI "bool \fBconf_general_store_mc_configuration\fP (\fBmc_configuration\fP *conf)"
.br
.ti -1c
.RI "bool \fBconf_general_detect_motor_param\fP (float current, float min_rpm, float low_duty, float *int_limit, float *bemf_coupling_k, int8_t *hall_table, int *hall_res)"
.br
.in -1c
.SS "Variables"

.in +1c
.ti -1c
.RI "uint16_t \fBVirtAddVarTab\fP [\fBNB_OF_VAR\fP]"
.br
.in -1c
.SH "Macro Definition Documentation"
.PP 
.SS "#define EEPROM_BASE_APPCONF   2000"

.SS "#define EEPROM_BASE_MCCONF   1000"

.SS "#define MC_DEFAULT_MOTOR_TYPE   \fBMOTOR_TYPE_BLDC\fP"

.SS "#define MCPWM_BATTERY_CUT_END   8\&.0"

.SS "#define MCPWM_BATTERY_CUT_START   10\&.0"

.SS "#define MCPWM_COMM_MODE   \fBCOMM_MODE_INTEGRATE\fP"

.SS "#define MCPWM_CURR_MAX_RPM_FBRAKE   300"

.SS "#define MCPWM_CURR_MAX_RPM_FBRAKE_CC   1500"

.SS "#define MCPWM_CURRENT_LIMIT_GAIN   0\&.5"

.SS "#define MCPWM_CURRENT_STARTUP_BOOST   0\&.01"

.SS "#define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC   0\&.8"

.SS "#define MCPWM_CYCLE_INT_START_RPM_BR   80000\&.0"

.SS "#define MCPWM_FAULT_STOP_TIME   3000"

.SS "#define MCPWM_HALL_ERPM   2000\&.0"

.SS "#define MCPWM_HALL_TAB_0   \-1"

.SS "#define MCPWM_HALL_TAB_1   1"

.SS "#define MCPWM_HALL_TAB_2   3"

.SS "#define MCPWM_HALL_TAB_3   2"

.SS "#define MCPWM_HALL_TAB_4   5"

.SS "#define MCPWM_HALL_TAB_5   6"

.SS "#define MCPWM_HALL_TAB_6   4"

.SS "#define MCPWM_HALL_TAB_7   \-1"

.SS "#define MCPWM_LIM_TEMP_FET_END   100\&.0"

.SS "#define MCPWM_LIM_TEMP_FET_START   80\&.0"

.SS "#define MCPWM_LIM_TEMP_MOTOR_END   100\&.0"

.SS "#define MCPWM_LIM_TEMP_MOTOR_START   80\&.0"

.SS "#define MCPWM_MAX_DUTY   0\&.95"

.SS "#define MCPWM_MAX_FB_CURR_DIR_CHANGE   10\&.0"

.SS "#define MCPWM_MAX_VOLTAGE   50\&.0"

.SS "#define MCPWM_MIN_DUTY   0\&.005"

.SS "#define MCPWM_MIN_VOLTAGE   8\&.0"

.SS "#define MCPWM_PWM_MODE   \fBPWM_MODE_SYNCHRONOUS\fP"

.SS "#define MCPWM_RAMP_STEP   0\&.02"

.SS "#define MCPWM_RAMP_STEP_RPM_LIMIT   0\&.0005"

.SS "#define MCPWM_RPM_LIMIT_NEG_TORQUE   true"

.SS "#define MCPWM_RPM_MAX   100000\&.0"

.SS "#define MCPWM_RPM_MIN   \-100000\&.0"

.SS "#define MCPWM_SLOW_ABS_OVERCURRENT   false"

.SH "Function Documentation"
.PP 
.SS "bool conf_general_detect_motor_param (float current, float min_rpm, float low_duty, float * int_limit, float * bemf_coupling_k, int8_t * hall_table, int * hall_res)"

.SS "void conf_general_init (void)"

.SS "void conf_general_read_app_configuration (\fBapp_configuration\fP * conf)"
Read \fBapp_configuration\fP from EEPROM\&. If this fails, default values will be used\&.
.PP
\fBParameters:\fP
.RS 4
\fIconf\fP A pointer to a \fBapp_configuration\fP struct to write the read configuration to\&. 
.RE
.PP

.SS "void conf_general_read_mc_configuration (\fBmc_configuration\fP * conf)"
Read \fBmc_configuration\fP from EEPROM\&. If this fails, default values will be used\&.
.PP
\fBParameters:\fP
.RS 4
\fIconf\fP A pointer to a \fBmc_configuration\fP struct to write the read configuration to\&. 
.RE
.PP

.SS "bool conf_general_store_app_configuration (\fBapp_configuration\fP * conf)"
Write \fBapp_configuration\fP to EEPROM\&.
.PP
\fBParameters:\fP
.RS 4
\fIconf\fP A pointer to the configuration that should be stored\&. 
.RE
.PP

.SS "bool conf_general_store_mc_configuration (\fBmc_configuration\fP * conf)"
Write \fBmc_configuration\fP to EEPROM\&.
.PP
\fBParameters:\fP
.RS 4
\fIconf\fP A pointer to the configuration that should be stored\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen from the source code\&.
